package run.siyuan.jdk.测试;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.cron.CronUtil;
import org.junit.jupiter.api.Test;

/**
 * &#064;className:  Demo .class
 * &#064;Description:  TODO a
 * &#064;author:  yuan
 * &#064;date:  2022/9/3 13:52
 * @author siyuan
 */
public class Demo {

    @Test
    public void test1() {
        System.out.println(DateUtil.offsetDay(DateUtil.parse("2022-10-09 22:00:00"), 90));

        System.out.println(DateUtil.current());

    }

    @Test
    public void test2() {
        System.out.println((15) / 2);
        System.out.println((2.0e-6 * 100000000.1));
    }

    @Test
    public void test3(){
        CronUtil.schedule("111","0/1 * * * * ?",()->{
            System.out.println(111);
        });
        CronUtil.schedule("222","0/3 * * * * ?",()->{
            System.out.println(222);
        });
        CronUtil.setMatchSecond(true);

    }

    @Test
    public void test4(){
        System.out.println(RandomUtil.randomInt(1,10) * 60L);
        System.out.println(DateUtil.offsetDay(DateUtil.date(1666165535546L), 19).getTime());

        for (int i = 0; i < 5; i++) {
            try{
                System.out.println("code"+i);
//                int a = 1/ 0;
                break;
            }catch (Exception e){
                System.out.println("exception"+i);
            }finally {
                System.out.println("finally"+i);
            }
//                break;
        }

    }

    /**
     *
     */
    @Test
    public void test5(){
        final int mb1 = 1024 * 1024;
        byte[] allocation1,allocation2,allocation3,allocation4;
        allocation1 = new byte[2 * mb1];
        allocation2 = new byte[2 * mb1];
        allocation3 = new byte[2 * mb1];
        allocation4 = new byte[4 * mb1];

    }


}



































